pub struct Solution;

impl Solution {
    pub fn maximum_count(nums: Vec<i32>) -> i32 {
        let i1 = nums.iter().take_while(|&&v| v < 0).count();
        let i2 = nums.iter().rev().take_while(|&&v| v > 0).count();
        return if i1 > i2 { i1 } else { i2 } as i32;
    }
}

#[test]
pub fn test() {
    assert_eq!(Solution::maximum_count(vec![-2, -1, -1, 1, 2, 3]), 3);
}